package com.glsc.ngateway.common.base.domain.mysql.gateway.other;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;


@Data
@Entity
@Builder
@Table(name = "t_am_digital_fees")
@org.hibernate.annotations.Table(appliesTo = "t_am_digital_fees", comment = "数字证书信息年费主表")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
public class DigitalKeyFees implements Serializable {
    private static final long serialVersionUID = 7302975544259643017L;

    @ApiModelProperty(value = "id")
    @Id
    @Column(name = "id", columnDefinition = "int COMMENT 'id'")
    private String id;

    @ApiModelProperty(value = "内部编码")
    @Column(name = "brn_org_no", columnDefinition = "varchar(40) COMMENT '内部编码'")
    private String brnOrgNo;

    @ApiModelProperty(value = "财务代码")
    @Column(name = "fin_code", columnDefinition = "varchar(40) COMMENT '财务代码'")
    private String finCode;

    @ApiModelProperty(value = "营业部名称")
    @Column(name = "brn_org_nm", columnDefinition = "varchar(255) COMMENT '机构名称'")
    private String brnOrgNm;


    //深交所年费数据
    @ApiModelProperty(value = "本年度年费-深交所")
    @Column(name = "annual_fee_sz", columnDefinition = "decimal(9,2) COMMENT '本年度年费-深交所'")
    private BigDecimal annualFeeSz;

    @ApiModelProperty(value = "本年度增值税-深交所")
    @Column(name = "annual_added_tax_sz", columnDefinition = "decimal(9,2) COMMENT '本年度增值税-深交所'")
    private BigDecimal annualAddedTaxSz;

    @ApiModelProperty(value = "抵扣上年度增值税-深交所")
    @Column(name = "previous_added_tax_sz", columnDefinition = "decimal(9,2) COMMENT '抵扣上年度增值税-深交所'")
    private BigDecimal previousAddedTaxSz;

    @ApiModelProperty(value = "分摊金额-深交所")
    @Column(name = "assessed_amount_sz", columnDefinition = "decimal(9,2) COMMENT '分摊金额-深交所'")
    private BigDecimal assessedAmountSz;

    @ApiModelProperty(value = "最终分摊结果-深交所")
    @Column(name = "final_allocation_result_sz", columnDefinition = "decimal(9,2) COMMENT '最终分摊结果-深交所'")
    private BigDecimal finalAllocationResultSz;


    //上交所年费数据
    @ApiModelProperty(value = "本年度年费-上交所")
    @Column(name = "annual_fee_sh", columnDefinition = "decimal(9,2) COMMENT '本年度年费-上交所'")
    private BigDecimal annualFeeSh;

    @ApiModelProperty(value = "本年度增值税-上交所")
    @Column(name = "annual_added_tax_sh", columnDefinition = "decimal(9,2) COMMENT '本年度增值税-上交所'")
    private BigDecimal annualAddedTaxSh;

    @ApiModelProperty(value = "抵扣上年度增值税-上交所")
    @Column(name = "previous_added_tax_sh", columnDefinition = "decimal(9,2) COMMENT '抵扣上年度增值税-上交所'")
    private BigDecimal previousAddedTaxSh;

    @ApiModelProperty(value = "分摊金额-上交所")
    @Column(name = "assessed_amount_sh", columnDefinition = "decimal(9,2) COMMENT '分摊金额-上交所'")
    private BigDecimal assessedAmountSh;

    @ApiModelProperty(value = "最终分摊结果-上交所")
    @Column(name = "final_allocation_result_sh", columnDefinition = "decimal(9,2) COMMENT '最终分摊结果-上交所'")
    private BigDecimal finalAllocationResultSh;


    //北交所年费数据
    @ApiModelProperty(value = "本年度年费-北交所")
    @Column(name = "annual_fee_bj", columnDefinition = "decimal(9,2) COMMENT '本年度年费-北交所'")
    private BigDecimal annualFeeBj;

    @ApiModelProperty(value = "本年度增值税-北交所")
    @Column(name = "annual_added_tax_bj", columnDefinition = "decimal(9,2) COMMENT '本年度增值税-北交所'")
    private BigDecimal annualAddedTaxBj;

    @ApiModelProperty(value = "抵扣上年度增值税-北交所")
    @Column(name = "previous_added_tax_bj", columnDefinition = "decimal(9,2) COMMENT '抵扣上年度增值税-北交所'")
    private BigDecimal previousAddedTaxBj;

    @ApiModelProperty(value = "分摊金额-北交所")
    @Column(name = "assessed_amount_bj", columnDefinition = "decimal(9,2) COMMENT '分摊金额-北交所'")
    private BigDecimal assessedAmountBj;

    @ApiModelProperty(value = "最终分摊结果-北交所")
    @Column(name = "final_allocation_result_bj", columnDefinition = "decimal(9,2) COMMENT '最终分摊结果-北交所'")
    private BigDecimal finalAllocationResultBj;




    @ApiModelProperty(value = "上交所明细汇总结果")
    @Transient
    private String detailResultSh;

    @ApiModelProperty(value = "深交所明细汇总结果")
    @Transient
    private String detailResultSz;

    @ApiModelProperty(value = "北交所明细汇总结果")
    @Transient
    private String detailResultBj;



    @ApiModelProperty(value = "OA部门名称")
    @Column(name = "oa_department_name", columnDefinition = "varchar(255) COMMENT 'OA部门名称'")
    private String oaDepartmentName;

    @ApiModelProperty(value = "OA部门领导账号")
    @Column(name = "oa_lead_account", columnDefinition = "varchar(40) COMMENT 'OA部门领导账号'")
    private String oaLeadAccount;

    @ApiModelProperty(value = "邮件发送结果说明")
    @Column(name = "email_send_res", columnDefinition = "varchar(255) COMMENT '邮件发送结果说明'")
    private String emailSendRes;


    @ApiModelProperty(value = "计费年度 格式：yyyy")
    @Column(name = "annual_fee_date", columnDefinition = "varchar(10) COMMENT '计费年度 格式：yyyy'")
    private String annualFeeDate;

    @ApiModelProperty(value = "状态：0待发送 1已发送")
    @Column(name = "status", columnDefinition = "varchar(10) COMMENT '状态：0待发送 1已发送 2发送失败'")
    private String status;

    @ApiModelProperty(value = "邮件id")
    @Column(name = "email_id", columnDefinition = "varchar(40) COMMENT '邮件id'")
    private String emailId;


    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time", columnDefinition = "datetime comment '创建时间'")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "操作时间")
    @Column(name = "op_time", columnDefinition = "datetime comment '操作时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime opTime;
}

